package com.atguigu.eduService.service;

import com.atguigu.eduService.entity.EduChapter;
import com.atguigu.eduService.entity.chapter.Chapter;
import com.baomidou.mybatisplus.extension.service.IService;

import java.util.List;

/**
 * <p>
 * 课程 服务类
 * </p>
 *
 * @author smday
 * @since 2020-07-27
 */
public interface EduChapterService extends IService<EduChapter> {

    /**
     * 根据课程id获取所有的章节和小节
     * @param courseId 课程id
     */
    List<Chapter> getAllChaptersByCourseId(String courseId);

    /**
     * 根据章节id删除章节,如果存在小节,不让其删除
     * @param chapterId 章节id
     */
    int deleteChapterById(String chapterId);

    /**
     * 还没加入小节寻找Chapter的方法
     * @param courseId 课程id
     */
    List<Chapter> getChapter(String courseId);

    /**
     * 根据课程id删除中章节id
     * @param courseId 课程id
     */
    void deleteChapterByCourseId(String courseId);
}
